package com.hcy.es.opt;

import com.alibaba.fastjson.JSON;
import com.hcy.es.pojo.Employee;
import com.hcy.esArsenal.api.EsDoor;
import com.hcy.esArsenal.wrapper.EsQueryWrapper;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Author huchenying
 * @Description
 * @Date 2021/9/10
 **/
public class test {

    @Resource
    EsDoor esDoor;

    @Test
    public void test(){
        EsQueryWrapper<Employee> wrapper = new EsQueryWrapper<>();
        wrapper.eq(Employee::getJob,"java");

        List<Map<String, Object>> employee = esDoor.query("employee", wrapper);
        String s = JSON.toJSONString(employee);
        System.out.println(s);
    }
}
